package com.gcxy.dto.score;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

@Data
@ApiModel(value = "学生详细成绩查询条件", description = "学生详细成绩查询条件")
public class StudentScoreDTO {
    /**
     * 机构ID
     */
    @ApiModelProperty("机构ID")
//    @NotNull(message = "机构ID必填")
    @Min(value = 1,  message = "机构ID大于1")
    private Integer agencyId;

    /**
     * 学期ID
     */
    @ApiModelProperty("学期ID")
    @NotNull(message = "学期ID必填")
    @Min(value = 1,  message = "学期ID大于1")
    private Integer semesterId;

    @ApiModelProperty(value = "学号")
    @Length(max = 15, message = "学号最多15个字")
    @Pattern(regexp = "^[A-Za-z0-9]+$", message = "用户账号只能输入英文或者数字")
    @NotBlank(message = "学号必填")
    private String studentNumber;

    @ApiModelProperty("学生姓名")
    @Length(max = 10, message = "用户姓名最多10个字")
    @Pattern(regexp = "^[\\u4e00-\\u9fa50-9]+$", message = "用户姓名只能输入中文或者数字")
    @NotBlank(message = "学生姓名必填")
    private String studentName;

    @ApiModelProperty("起始周")
    @Min(value = 1,  message = "起始周不小于1")
    private Integer startWeek;

    @ApiModelProperty("结束周")
    @Min(value = 1,  message = "结束周不小于1")
    private Integer endWeek;
}
